import request from '@/utils/request'
/**
 * 获取角色列表
 * page当前页
 * ***/
export function getRoleListApi(page, pagesize) {
  return request({
    method: 'get',
    url: '/sys/role',
    params: {
      page,
      pagesize
    }
  })
}

// 删除数据
export function deleteRoleApi(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'
  })
}

// 添加数据
export const addRoleApi = data => {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}

// 修改角色
export function editRpleApi(data) {
  return request({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}

// 根据id获取角色列表
export function getRoleDetailApi(id) {
  return request({
    method: 'get',
    url: `/sys/role/${id}`
  })
}

// 获取公司信息
export const getCompanyInfoApi = (id) => {
  return request({
    method: 'get',
    url: `/company/${id}`
  })
}
